//
//  WYHomePageSectionView.m
//  Boss
//
//  Created by admin on 2018/7/4.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYHomePageSectionView.h"

@implementation WYHomePageSectionView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        [self addSubview:self.segmentControl];
    }
    return self;
}

#pragma mark - Init Views

- (HMSegmentedControl *)segmentControl {
    if (!_segmentControl) {
        NSArray *titles = @[@"企业主页",@"产品服务",@"我的动态"];
        _segmentControl = [[HMSegmentedControl alloc] initWithSectionTitles:titles];
        _segmentControl.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44);
        _segmentControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
        _segmentControl.backgroundColor = [UIColor whiteColor];
        _segmentControl.selectionIndicatorHeight = 5.f;
        _segmentControl.selectionIndicatorColor = kColorMainColor;
        
        
        
        NSDictionary *attributesNormal = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"PingFangSC-Regular" size:14],NSFontAttributeName, [UIColor blackColor], NSForegroundColorAttributeName,nil];
        NSDictionary *attributesSelected = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"PingFangSC-Semibold" size:14],NSFontAttributeName, kColorMainColor, NSForegroundColorAttributeName,nil];
        _segmentControl.titleTextAttributes = attributesNormal;
        _segmentControl.selectedTitleTextAttributes = attributesSelected;
    }
    return _segmentControl;
}













@end
